package com.zhs.elasticsearch.orther;

import com.zhs.elasticsearch.match.eo.UserEO;

/**
 * 获取上下文
 * @Author zhenghuisheng
 * @Date：2025/7/8 16:12
 */
public class ThreadLocalStudy {

    private static final ThreadLocal<UserEO> UserEO_CONTEXT = new ThreadLocal<>();

    /* 登录用户Token信息 ThreadLocal方式 */
    public static void setUserEO(UserEO UserEO) {
        UserEO_CONTEXT.set(UserEO);
    }

    public static UserEO getUserEO() {
        return UserEO_CONTEXT.get();
    }

    public static void clearToken() {
        UserEO_CONTEXT.remove();
    }
    /* 登录用户Token信息 ThreadLocal方式 */
}
